package hw04.grammar.productions;

import java.util.LinkedList;
import java.util.List;

import hw04.grammar.terminals.Comma;
import hw04.grammar.terminals.Constant;
import hw04.grammar.terminals.OpenParen;
import hw04.grammar.terminals.Underscore;
import hw04.grammar.terminals.Variable;

public class PartialAttrList {
	
	private List<Object> value = new LinkedList<Object>();
	
	public PartialAttrList(OpenParen op, Constant c) {
		value.add(c);
	}

	public PartialAttrList(OpenParen op, Variable v) {
		value.add(v);
	}
	
	public PartialAttrList(OpenParen op, Underscore u) {
		value.add(u);
	}
	
	public PartialAttrList(PartialAttrList ppl, Comma _, Constant c) {
		value.addAll(ppl.getValue());
		value.add(c);
	}
	
	public PartialAttrList(PartialAttrList ppl, Comma _, Variable v) {
		value.addAll(ppl.getValue());
		value.add(v);
	}
	
	public PartialAttrList(PartialAttrList ppl, Comma _, Underscore u) {
		value.addAll(ppl.getValue());
		value.add(u);
	}
	
	public List<Object> getValue() {
		return value;
	}
	
	@Override
	public String toString() {
		return getClass().getSimpleName() + ":" + getValue().toString();
	}

}
